<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="javax.sql.*, java.sql.*, com.att.network.acronym.Util" %>
<%@include file="init.jsp" %>
<% ;
    int ret = 0;;
    Connection con = null;
    PreparedStatement st = null;
    String id = request.getParameter("id");
     
    if (id != null && !id.isEmpty()  ) {
        try {
            con = Util.getCon(db);
            st = con.prepareStatement("DELETE FROM acronym WHERE id=?");
            st.setString(1, id.trim());
           
            ret = st.executeUpdate();

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            con.close();
        }
    }
    if (ret < 1) {
        out.println("Some error happens: Try again");
    } else {
         out.println("The entry was deleted!");
    //response.sendRedirect("index.jsp?q=" + name);
  }%>